package com.hdu.clj.dncard.util

import android.content.Context
import com.hdu.clj.dncard.databaseUtil.EquipDatabaseUtil

class GetEquip{

    private val equiplist = arrayOf("10002","20002","30002","40002","50002","10003","20003","30003","40003","50003",
        "10004","20004","30004","40004","50004","10005","20005","30005","40005","50005")

    fun isGetEquip():Boolean{
        val score = (0..99).random()
        if (score>50){
            return true
        }
        return false
    }

    fun randomEquip(context: Context,lv:Int):Array<String>{
        var select = 0
        when(lv){
            1 -> select = (0..4).random()
            2 -> select = (5..9).random()
            3 -> select = (10..14).random()
            4 -> select = (15..19).random()
        }
        val equip = equiplist[select]
        return arrayOf(EquipDatabaseUtil().efindname(context,equip),equip)
    }

    fun updateEquip(context: Context,eid:String,user:String){

    }

}